﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using LastoRevival.Website.Settings;

namespace LastoRevival.Website.Models
{
	public class SiteUserSettings
	{
		public string Theme { get; set; }
		public int CollapseThreshold { get; set; }
		public bool SmileysByDefault { get; set; }
		public bool ShowSignatures { get; set; }
		public bool ReturnToListAfterPosting { get; set; }
		public double TimeOffset { get; set; }

		public SiteUserSettings()
		{

		}
		
		public static SiteUserSettings CreateAnonymous()
		{
			var instance = new SiteUserSettings
			{
				CollapseThreshold = WebsiteSettings.GetInstance().DefaultCollapseThreshold,
				Theme = WebsiteSettings.GetInstance().DefaultTheme,
				ReturnToListAfterPosting = true,
				ShowSignatures = true,
				SmileysByDefault = true,
			};

			return instance;
		}

		public bool CollapseThreads
		{
			get
			{
				return CollapseThreshold > 0;
			}
		}
	}
}